package org.sixtynine.stock.util;

public class SignalCompator {

	public static double highComparator(double[] allHigh, int days) {
		if (allHigh.length >= days) {
			double high = 0.00;
			for (int i = 0; i < days; i++) {
				if (high < allHigh[i]) {
					high = allHigh[i];
				}
			}
			return high;
		} else {
			return -1;
		}
	}

	public static double lowComparator(double[] allLow, int days) {
		if (allLow.length >= days) {
			double low = Double.MAX_VALUE;
			for (int i = 0; i < days; i++) {
				if (low > allLow[i]) {
					low = allLow[i];
				}
			}
			return low;
		} else {
			return -1;
		}
	}
}
